home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15094 < prev    next >
Encoding:
Text File  |  1996-08-05  |  657 b   |  27 lines

  1. Path: news.production.compuserve.com!news
  2. From: Alan Huff <74312.2300@CompuServe.COM>
  3. Newsgroups: comp.lang.c++
  4. Subject: Constructor member initializer list
  5. Date: 3 Apr 1996 16:50:28 GMT
  6. Organization: Motorola Lexicus
  7. Message-ID: <4jua8k$fa1$2@mhadg.production.compuserve.com>
  8.  
  9. How do you initialize class members in the initializer list if the 
  10. member is a structure?
  11.  
  12. Consider the following code fragment.
  13.  
  14. typedef struct _tagRect {
  15.    int      x;
  16.    int      y;
  17.    int      w;
  18.    int      h;
  19. } RECTANGLE;
  20.  
  21. class Foo {
  22.    Foo() : <how do I initialize fooRect and it's members> {};
  23.    RECTANGLE   fooRect;
  24. };
  25.  
  26. Any suggestions would be greatly appreciated.
  27.